<template>
  <div class="header-container">
    <div class="l-container">
        <el-button @click="handleMenu" icon="el-icon-menu" size="mini"></el-button>
        <span class="text">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item v-for="item in tags" :key="item.path" :to="{ path: item.path }">{{item.label}}</el-breadcrumb-item>
                
            </el-breadcrumb>
        </span>
    </div>
    <div class="r-container">
        <el-dropdown>
            <span class="el-dropdown-link">
                <img class="user" src="../assets/images/user.png" alt="">
            </span>
            <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>个人中心</el-dropdown-item>
                <el-dropdown-item>退出</el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
    data () {
        return {
            
        }
    },
    methods: {
        handleMenu(){
            this.$store.commit('collapseMenu')
        }
    },
    computed: {
        ...mapState({
            tags: state => state.tab.tabsList
        })
    },
    // mounted () {
    //     console.log(this.tags)
    // }
}
</script>

<style lang="less" scoped>
    .header-container{
        padding: 0;
        background-color: #333;
        height: 60px;
        display: flex;
        align-items: center;//纵轴
        justify-content: space-between;//主轴
        .l-container{
            display: flex;
            align-items: center;
            padding-left: 10px;
            .text{
                font-size: 14px;
                color: #fff;
                padding: 0 20px;
                /deep/.el-breadcrumb__item{
                        .el-breadcrumb__inner{
                            font-weight: normal;
                            &.is-link{
                                color:#666;
                        }
                    }
                    &:last-child{
                        .el-breadcrumb__inner{
                            color:#fff;
                        }
                    }
                }
                
            }
        }
        .r-container{
            .user{
                width: 40px;
                height: 40px;
                border-radius: 50%;
                padding-right: 10px;
            }
        }
    }
</style>>

